<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>网站管理中心</title>
<%@ include file="/pages/common/common.jsp" %>	
<link rel="stylesheet" href="../css/style7.css">
<STYLE>
BODY {
 SCROLLBAR-FACE-COLOR: #EDEDED;
 SCROLLBAR-HIGHLIGHT-COLOR: #FAFAFA;
 SCROLLBAR-SHADOW-COLOR: #ffffff;
 SCROLLBAR-LIGHT-COLOR: #33709F;
 SCROLLBAR-ARROW-COLOR: #33709F;
 SCROLLBAR-TRACK-COLOR: #F4F4F4;
 SCROLLBAR-DARKSHADOW-COLOR: #939393;
 SCROLLBAR-BASE-COLOR: #fcfcfc
}
</STYLE>

<script type="text/javascript">
<!--
	function subform()
	{
	     if(document.frmInfo.userid.value=="")
		{    
		alert('用户名不能为空！');    
		document.frmInfo.userid.focus();    
		return false;    
		}
	    if(document.frmInfo.user_password.value=="")
		{    
		alert('密码不能为空！');    
		document.frmInfo.user_password.focus();    
		return false;    
		}
	    return true;
	}
	function auto_focus(){
		 if (document.getElementById) {
		 	document.getElementById('userid').focus();
		 }
	 }

//为了避免SEESION过期后登录窗口在iframe中出现的情况
	if(window.parent.location.href.indexOf('/pages/index.jsp')!=-1){
		alert('会话过期，请重新登录');
		window.parent.location.href='${ctx}/pages/login.jsp';
	}
	
		$(function(){
			//回车键触发登录
			$("body").keydown(function(event){
				if(event.keyCode==13)
					loginSys();
			});
		});
	
	function loginSys(){
		var r = subform();
		if(!r) {
			return false;
		}
		//var url="${ctx}/login/login.adm";
		var param = "personUsername="+document.frmInfo.userid.value;
		param += "&personPassword="+document.frmInfo.user_password.value;
		
		//alert(param);
		
		$.post("${ctx}/login/login.adm",param,function(data){
			//alert(data);
			if(data.success){//操作成功
				//window.alert("xxx");
				var strHref=window.location.href;
   				strHref=strHref.substr(0,strHref.lastIndexOf("tams")-1);
   				//alert(strHref+"${ctx}/index.adm");
				window.location.href=strHref+"${ctx}/index.adm";	
			}else{
				$.messager.alert('提示',data.msg,'warning');	
			}
		});
		
		//alert('xxxx');
	}
	
	function resetLogin(){
		document.frmInfo.userid.value="";
		document.frmInfo.user_password.value="";
	}

//-->
</script>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <form name=frmInfo method=post action="../glzxIndex.do" onSubmit="return subform()" language=javascript>
  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><table width="1004" height="626" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td background="../img/glzx/001.jpg"> <table width="770" border="0" cellpadding="0" cellspacing="0" height="432" align="center">
                <tr valign="top"> 
                  <td height="430"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td height="295" valign="top"><table width="326" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="113" height="137">&nbsp;</td>
                              <td width="213">&nbsp;</td>
                            </tr>
                            <tr> 
                              <td height="34">&nbsp;</td>
                              <td><input type="text" name="userid" class="input020"  onFocus=""></td>
                            </tr>
                            <tr> 
                              <td rowspan="2">&nbsp;</td>
                              <td height="12"></td>
                            </tr>
                            <tr> 
                              <td><input type="password" name="user_password" class="input030"></td>
                            </tr>
                            <tr> 
                              <td height="40">&nbsp;</td>
                              <td valign="bottom"> <img src="../img/glzx/002.jpg" width="54" height="19" style="cursor: pointer;" onclick="loginSys();">
                                &nbsp;&nbsp; <img src="../img/glzx/003.jpg" width="54" height="19" style="cursor: pointer;" onclick="resetLogin();"></td>
                               
                            </tr>
                          </table></td>
                      </tr>
                      <tr> 
                        <td height="79"> <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
                            <tr> 
                              <td width="12%"> <font color="red" size="+1"><b> 
                                <html:errors/> <logic:present name="errors" scope="request"> 
                                <bean:write name="errors" property="errors" /> 
                                </logic:present> </b> </font> 
                                
                              </td>
                            </tr>
                            <tr valign="bottom"> 
                              <td width="88%" height="40" colspan="9"> <div align="center"><font color="#63D2FD"><br>Copyright &copy; 2000 - 2012   All　Rights Reserved</font></div></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>

</body>
</html>
